from flask import render_template, Blueprint, redirect, url_for
from flask_login import current_user

index_bp = Blueprint('Index', __name__, url_prefix='/')


@index_bp.route('/')
def index():
    if current_user.is_authenticated:
        return redirect(url_for('admin.index'))
    return render_template('admin/login.html')
